package cn.xiuxius.embedded;
import cn.xiuxius.embedded.command.InitCommand;
import cn.xiuxius.embedded.command.TaskCommand;
import cn.xiuxius.embedded.command.com.ComCommand;
import cn.xiuxius.embedded.command.extension.ExCommand;
import cn.xiuxius.embedded.command.preprocess.ProcessCommand;
import picocli.CommandLine;

@CommandLine.Command(
        name = "EasySTC",
        mixinStandardHelpOptions = true,
        version = "1.0",
        description = "A CLI tool for managing keil embedded projects.",
        subcommands = {
                InitCommand.class,
                TaskCommand.class,
                ComCommand.class,
                ExCommand.class,
                ProcessCommand.class
        }
)
public class EasySTC implements Runnable {

    public static void main(String[] args) {
        CommandLine cmd = new CommandLine(new EasySTC())
                .setColorScheme(CommandLine.Help.defaultColorScheme(CommandLine.Help.Ansi.ON)) // 强制开启颜色
                .setUsageHelpAutoWidth(true);
        int exitCode = cmd.execute(args);
        System.exit(exitCode);
    }

    @Override
    public void run() {
        CommandLine.usage(this, System.out);
    }
}
